#ifndef MGCTOOLBOX_H
#define MGCTOOLBOX_H

#include <QObject>

#include "MGCApplication.h"

class MGCCorePlugin;

class MGCToolbox : public QObject
{
    Q_OBJECT
public:
    explicit MGCToolbox(MGCApplication* app);

    MGCCorePlugin *corePlugin() const;

private:
    void setChildToolboxes(void);

    friend class MGCApplication;
signals:

private:
    MGCCorePlugin *_corePlugin = nullptr;

};

/// This is the base class for all tools
class MGCTool : public QObject {
    Q_OBJECT

public:
    // All tools must be parented to the QGCToolbox and go through a two phase creation. In the constructor the toolbox
    // should only be passed to QGCTool constructor for correct parenting. It should not be referenced or set in the
    // protected member. Then in the second phase of setToolbox calls is where you can reference the toolbox.
    MGCTool(MGCApplication* app, MGCToolbox* toolbox);

    // If you override this method, you must call the base class.
    virtual void setToolbox(MGCToolbox* toolbox);

protected:
    MGCApplication* _app;
    MGCToolbox*     _toolbox;
};

#endif // MGCTOOLBOX_H
